<?php

namespace app\api\controller;
use app\BaseController;

use app\model\Teacher as T;

class Teacher extends ApiBase
{
    //list 
    public function list()
    {
        $list = (new T())->where('status',1)->order('weight','desc')->select()->toArray();
        $list = array_map(function($item){
            $item['avatar'] = $item['avatar'];
            $item['pic'] = $item['pic'];
            return $item;
        },$list);
        return $this->returnApi($list,code: 0);
    }
}